package com.cn.hotel.service.impl;

import com.cn.hotel.dao.IFacilitiesDao;
import com.cn.hotel.dao.Impl.FacilitiesImpl;
import com.cn.hotel.model.FacilitiesModel;
import com.cn.hotel.service.IFacilitiesService;

import java.util.List;

public class FacilitiesServiceImpl implements IFacilitiesService {
    /**
     * 查询所有
     * @param facilitiesModel
     * @return
     */
    @Override
    public List<FacilitiesModel> findAll(FacilitiesModel facilitiesModel) {
        IFacilitiesDao iFacilitiesDao = new FacilitiesImpl();
        return iFacilitiesDao.findAll(facilitiesModel);
    }

    /**
     * 获取总数据条数
     * @return
     */
    @Override
    public int getNumber(FacilitiesModel facilitiesModel) {
        IFacilitiesDao iFacilitiesDao = new FacilitiesImpl();
        return iFacilitiesDao.getNumber(facilitiesModel);
    }

    /**
     * 新增
     * @param facilitiesModel
     * @return
     */
    @Override
    public int add(FacilitiesModel facilitiesModel) {
        IFacilitiesDao iFacilitiesDao = new FacilitiesImpl();
        return iFacilitiesDao.add(facilitiesModel);
    }
//id查询
    @Override
    public FacilitiesModel findById(Integer temp) {
        IFacilitiesDao iFacilitiesDao = new FacilitiesImpl();
        return iFacilitiesDao.findById(temp);
    }

    @Override
    public int edit(FacilitiesModel facilitiesModel) {
        IFacilitiesDao iFacilitiesDao = new FacilitiesImpl();
        return iFacilitiesDao.edit(facilitiesModel);
    }

    @Override
    public int delete(Integer temp) {
        IFacilitiesDao iFacilitiesDao = new FacilitiesImpl();
        return iFacilitiesDao.delete(temp);
    }

    @Override
    public List<FacilitiesModel> getFacilitiesModel() {
        IFacilitiesDao iFacilitiesDao = new FacilitiesImpl();
        return iFacilitiesDao.getFacilitiesModel();
    }
}
